#ifndef __GLUTAPP__
#define __GLUTAPP__

#include "gl.h"

class GlutApp {
private:
	static GlutApp* instance;
	static int GlutAppKmap[];

protected:
	virtual void display();
	virtual void keyboard(const unsigned char);
	virtual void mouse(const int, const int, const int, const int);
	virtual void idle();
	virtual void timer();

	bool keyPressed(const unsigned char);
	double aspectRatio;

	bool specialPressed(const unsigned char, const int);

public:
	GlutApp();

	void run();

	friend void GlutAppResize(const int, const int);
	friend void GlutAppKeyboard(const unsigned char, const int, const int);
	friend void GlutAppKeyboardUp(const unsigned char, const int, const int);
	friend void GlutAppSpecial(const int, const int, const int);
	friend void GlutAppMouse(const int, const int, const int, const int);
	friend void GlutAppMotion(const int, const int);
	friend void GlutAppPassiveMotion(const int, const int);
	friend void GlutAppTimer(const int);
	friend void GlutAppDisplay();
	friend void GlutAppIdle();
};

#endif
